<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('招聘需求申请表新增及修改')" />
	<th:block th:include="include :: businessCSS" />
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
	<form class="layui-form head-form">
	    <div class="north">
            <th:block th:include="include :: business_btn" />
	        <th:block th:include="include :: business_tpl('top')" />
			<!-- 静态表格 -->
		    <div style="margin:10px">
			  	<table class="layui-table" lay-size="sm">
<!-- 			    <colgroup> -->
<!-- 			      <col width="150"> -->
<!-- 			      <col width="100"> -->
<!-- 			      <col width="150"> -->
<!-- 			    </colgroup> -->
				<thead>
			      <tr>
			        <th colspan="6">岗位基本信息</th>
			      </tr> 
			    </thead>
			    <tbody>
		    	  <tr>
			        <td class="table-title"><font class="f_red">*</font>岗位名称</td>
			        <td th:if="${!gridColumns.readOnly}">
			        	<input type="text" id="vGwMc" name="vGwMc" autocomplete="off" class="layui-input" onkeyup="inputMatch('vGwMc','vGwBm')"/>
			        	<i class="layui-icon layui-icon-more getMore" style="position:absolute" onclick="getMore('vGwMc',null,'岗位','ts_roleinfo');"></i>
		        	</td>
		        	<td th:if="${gridColumns.readOnly}">
			        	<input type="text" id="vGwMc" name="vGwMc" class="layui-input" readonly/>
		        	</td>
			        <td class="table-title">招聘人数</td>
			        <td><input type="text" id="vZpRs" name="vZpRs" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">已入职人数</td>
			        <td><input type="text" id="fRzRs" name="fRzRs" autocomplete="off" class="layui-input" disabled></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">直属领导</td>
			        <td th:if="${!gridColumns.readOnly}" onclick="getMore('lUserName',null,'直属领导','ts_userinfo');">
			        	<input type="text" name="lUserName" id="lUserName" class="layui-input" readonly/>
				  		<i class="layui-icon layui-icon-more getMore" style="position:absolute"></i>
			  		</td>
			  		<td th:if="${gridColumns.readOnly}">
			        	<input type="text" name="lUserName" id="lUserName" class="layui-input" readonly/>
			  		</td>
			        <td class="table-title">工作区域</td>
			        <td><input type="text" id="vGzQy" name="vGzQy" autocomplete="off" class="layui-input"></td>
			        <td class="table-title">薪酬范围</td>
			        <td><input type="text" id="vXcFw" name="vXcFw" autocomplete="off" class="layui-input" placeholder="提示：建议填写薪资区间范围（如5K-6K）"></td>
			      </tr>
			      <tr>
			        <td class="table-title">岗位类别</td>
			        <td colspan="3">
			        	<input type="radio" name="vGwLb" value="1" title="全职" checked>
			        	<input type="radio" name="vGwLb" value="2" title="实习">
			        	<input type="radio" name="vGwLb" value="3" title="兼职">
		        	</td>
			        <td class="table-title">期望到岗时间</td>
			        <td><input type="text" id="dDgSk" name="dDgSk" autocomplete="off" readonly class="layui-input" lay-verify="date" placeholder="请选择时间"/></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">需求原因（性质）</td>
			        <td colspan="2">
			        	<input type="radio" name="vXqYy" value="1" title="新增需求" checked>
			        	<input type="radio" name="vXqYy" value="2" title="离职补员">
			        	<input type="radio" name="vXqYy" value="3" title="人员储备">
			        	<input type="radio" name="vXqYy" value="4" title="其他">
			        </td>
			        <td colspan="3"><input type="text" id="vXqYy" autocomplete="off" class="layui-input" placeholder="提示：其他原因（选填）"></td>
			      </tr>
		    	  <tr>
			        <td class="table-title">岗位说明书</td>
			        <td colspan="4">
			        	<input type="text" name="gwBid" id="gwBid" class="layui-input" readonly/>
			  		</td>
			  		<td class="text_c">
						<a th:if="${!gridColumns.readOnly}" class="layui-btn layui-btn-xs dhicon dh-search layui-btn-warm" onclick="getMore('gwBid')">&nbsp;选择</a>
						<a class="layui-btn layui-btn-xs dhicon dh-eye layui-btn-normal" onclick="openGwSms()">&nbsp;查看</a>
						<a th:if="${!gridColumns.readOnly}" class="layui-btn layui-btn-xs dhicon dh-edit" onclick="newGwSms()">&nbsp;编辑</a>
			  		</td>
			      </tr>
			      </tbody>
			  </table>
		  	</div>
    	</div>
	   	<th:block th:include="include :: pageFooter" /> 
        </form>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: businessJS" />
<th:block th:include="include :: businessTableBtn" />
<th:block th:include="include :: inlineJS" />
<script type="text/javascript">
var $,layer,form,laydate,element;//定义layui模块
var nid = $("#nid").val(),noTable;//定义全局参数
layui.use(['laydate','form','layer','jquery','util','element'], function () {
 	$ = layui.$,layer = layui.layer,form = layui.form,laydate = layui.laydate,util = layui.util,element=layui.element;
 	beforeInit();//表单初始化之前的动作集合
 	if(!gridColumns.readOnly)laydate.render({elem:'#dDgSk'});
 	layui.element.render();
 	$.get("/hr/recruitmentapply/listbynid?nid="+nid,function(res){
 		noTable=res.data;
	});
 	$.each(t_fields,function(v,k){//初始赋值
 		if(k.fields=="vGwLb" || k.fields=="vXqYy"){
 			if(k.fieldContent){
 				if(isNaN(parseInt(k.fieldContent))){//不是数字时
 					$('#'+k.fields).val(k.fieldContent);
 					$("input[name=vXqYy]").last().val($('#vXqYy').val());
 				}
 				$("input[name="+k.fields+"][value="+k.fieldContent+"]").attr("checked",true);
 			}
 			if(gridColumns.readOnly)$("input[name="+k.fields+"]").attr('disabled','disabled');
 		}else $('#'+k.fields).val(k.fieldContent);
 	})
 	if(gridColumns.readOnly){//流程结束后静态表格变为不可编辑
 	 	$('table input').attr('readonly','readonly');
		$('table .canntEdit').removeClass('canntEdit');
 	}
 	form.render();
})
$('#vXqYy').blur(function(){//勾选同name最后一个单选框并修改其value
	$("input[name=vXqYy]").last().click();
	$("input[name=vXqYy]").last().val($('#vXqYy').val());
 	form.render();
})
function openGwSms(){
	if($('#gwBid').val())parent.layui.index.openTabsPage('hr/positioninstructions/edit?nid='+$('#pGuid').val(), '岗位说明书'+'('+$('#gwBid').val()+')');
	else layer.msg("请选择岗位说明书！", {icon:5});
}
function newGwSms(){//新增岗位说明书
	parent.layui.index.openTabsPage('hr/positioninstructions/edit', '岗位说明书 - 新增');
}
function inputMatch(i,v){
	$('#'+v).val($('#'+i).val());
}
</script>
</body>
</html>